package com.hserver.docker.service.impl;

import com.hserver.docker.config.ConstConfig;
import com.hserver.docker.service.LogService;
import com.hserver.docker.utils.FileUtil;
import cn.hserver.core.ioc.annotation.Bean;

@Bean
public class LogServiceImpl implements LogService {

    @Override
    public void add(String recordId, String log) {
        FileUtil.write(ConstConfig.LOG_PATH + recordId + ".log", log);
    }

    @Override
    public String getLastData(String recordId){
        return FileUtil.read(ConstConfig.LOG_PATH + recordId + ".log", 200);
    }
}
